package com.eascs.tdriskcloud.service.impl;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javax.inject.Inject;

import org.springframework.stereotype.Service;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.eascs.afterloan.controller.BankCardRestController;
import com.eascs.app.log.Logger;
import com.eascs.app.log.LoggerFactory;
import com.eascs.tdriskcloud.dao.HitInfoParsDao;
import com.eascs.tdriskcloud.entity.TdHitsInformation;
import com.eascs.tdriskcloud.form.conditions.ConActiveDaysOne;
import com.eascs.tdriskcloud.form.conditions.ConActiveDaysTwo;
import com.eascs.tdriskcloud.form.conditions.ConAndroidCheatApp;
import com.eascs.tdriskcloud.form.conditions.ConAndroidEmulator;
import com.eascs.tdriskcloud.form.conditions.ConAssociationIndustry;
import com.eascs.tdriskcloud.form.conditions.ConAssociationPartner;
import com.eascs.tdriskcloud.form.conditions.ConBlanckList;
import com.eascs.tdriskcloud.form.conditions.ConCalculate;
import com.eascs.tdriskcloud.form.conditions.ConCount;
import com.eascs.tdriskcloud.form.conditions.ConCrossEvent;
import com.eascs.tdriskcloud.form.conditions.ConCrossPartner;
import com.eascs.tdriskcloud.form.conditions.ConCrossVelocityDistinct;
import com.eascs.tdriskcloud.form.conditions.ConCrossVelocityOneDim;
import com.eascs.tdriskcloud.form.conditions.ConCustomList;
import com.eascs.tdriskcloud.form.conditions.ConDeviceStatusAbnormal;
import com.eascs.tdriskcloud.form.conditions.ConDiscreditCount;
import com.eascs.tdriskcloud.form.conditions.ConEventTimeDiff;
import com.eascs.tdriskcloud.form.conditions.ConFourCalculation;
import com.eascs.tdriskcloud.form.conditions.ConFpException;
import com.eascs.tdriskcloud.form.conditions.ConFrequencyCount;
import com.eascs.tdriskcloud.form.conditions.ConFrequencyDistinct;
import com.eascs.tdriskcloud.form.conditions.ConFrequencyOneDim;
import com.eascs.tdriskcloud.form.conditions.ConFuzzyBlackList;
import com.eascs.tdriskcloud.form.conditions.ConGeoIpDistance;
import com.eascs.tdriskcloud.form.conditions.ConGpsDistance;
import com.eascs.tdriskcloud.form.conditions.ConGreyList;
import com.eascs.tdriskcloud.form.conditions.ConIosCheatApp;
import com.eascs.tdriskcloud.form.conditions.ConKeyword;
import com.eascs.tdriskcloud.form.conditions.ConLastMatch;
import com.eascs.tdriskcloud.form.conditions.ConMatchAddress;
import com.eascs.tdriskcloud.form.conditions.ConProxyIp;
import com.eascs.tdriskcloud.form.conditions.ConRegex;
import com.eascs.tdriskcloud.form.conditions.ConSuspectedTeam;
import com.eascs.tdriskcloud.form.conditions.ConTimeDiff;
import com.eascs.tdriskcloud.form.conditions.ConUsualBrowser;
import com.eascs.tdriskcloud.form.hits.HitsAssResultsForDim;
import com.eascs.tdriskcloud.form.hits.HitsAssociationPartner;
import com.eascs.tdriskcloud.form.hits.HitsBlackList;
import com.eascs.tdriskcloud.form.hits.HitsCrossPartner;
import com.eascs.tdriskcloud.form.hits.HitsDiscreditCount;
import com.eascs.tdriskcloud.form.hits.HitsForDim;
import com.eascs.tdriskcloud.form.hits.HitsForDimCross;
import com.eascs.tdriskcloud.form.hits.HitsFuzzyBlackList;
import com.eascs.tdriskcloud.form.hits.HitsGreyList;
import com.eascs.tdriskcloud.form.hits.HitsResultsForDim;
import com.eascs.tdriskcloud.form.hits.HitsResultsForDimCross;
import com.eascs.tdriskcloud.service.HitInfoParsService;

@Service
public class HitInfoParsServiceImpl implements HitInfoParsService {

	private static Logger log = LoggerFactory.getLogger(BankCardRestController.class);

	@Inject
	HitInfoParsDao hitDao;

	@Override
	public TdHitsInformation queryHitsInfoEntity(String id) {
		return hitDao.queryHit(id);
	}

	@Override
	public List<TdHitsInformation> queryHitsInfoByTdId(String tdId) {
		return hitDao.queryHitInfo(tdId);
	}

	// 当type为black_list时
	@Override
	public List<ConBlanckList> parsHitsBlackList(TdHitsInformation entity) {
		String conditions = entity.getConditions();

		List<ConBlanckList> conBlackList = new ArrayList<>();
		// 解释JSONArray
		JSONArray jarr = JSONArray.parseArray(conditions);
		for (Iterator iterator = jarr.iterator(); iterator.hasNext();) {
			ConBlanckList con = new ConBlanckList();
			JSONObject job = (JSONObject) iterator.next();
			String dimType = job.get("dimType").toString();
			con.setDimType(dimType);
			log.info("dimType:" + dimType);
			String dimValue = job.get("dimValue").toString();
			con.setDimValue(dimValue);
			log.info("dimValue:" + dimValue);
			String hits = job.get("hits").toString();
			log.info("hits:" + hits);
			String types = job.get("type").toString();
			con.setType(types);
			log.info("types:" + types);
			log.info("/////////////////////////////////////////////////");
			JSONArray hitsJarr = JSONArray.parseArray(hits);
			List<HitsBlackList> blackList = new ArrayList<>();
			for (Iterator iteratorHit = hitsJarr.iterator(); iteratorHit.hasNext();) {
				JSONObject jobHit = (JSONObject) iteratorHit.next();
				Map<String, Object> key = jobHit;
				Object[] keys = key.keySet().toArray();
				// 初始化
				HitsBlackList hit = forBlackList(jobHit, keys);
				blackList.add(hit);
			}
			con.setHits(blackList);
			conBlackList.add(con);
		}
		return conBlackList;
	}

	// 当type为custom_list时
	@Override
	public List<ConCustomList> parsHitsCustomList(TdHitsInformation entity) {
		String conditions = entity.getConditions();

		List<ConCustomList> conCustomList = new ArrayList<>();
		// 解释JSONArray
		JSONArray jarr = JSONArray.parseArray(conditions);
		for (Iterator iterator = jarr.iterator(); iterator.hasNext();) {
			ConCustomList con = new ConCustomList();
			JSONObject job = (JSONObject) iterator.next();
			String dimType = job.get("dimType").toString();
			con.setDimType(dimType);
			log.info("dimType:" + dimType);
			String dimValue = job.get("dimValue").toString();
			con.setDimValue(dimValue);
			log.info("dimValue:" + dimValue);
			String list = job.get("list").toString();
			log.info("list:" + list);
			String types = job.get("type").toString();
			con.setType(types);
			log.info("types:" + types);
			log.info("/////////////////////////////////////////////////");
			JSONArray listJarr = JSONArray.parseArray(list);
			List<String> customList = new ArrayList<>();
			Object[] arr = listJarr.toArray();
			for (int i = 0; i < arr.length; i++) {
				String arrValue = arr[i].toString();
				customList.add(arrValue);
			}
			con.setList(customList);
			conCustomList.add(con);
		}
		return conCustomList;
	}

	// 当type为discredit_count时
	@Override
	public List<ConDiscreditCount> parsHitsDiscreditCount(TdHitsInformation entity) {
		String conditions = entity.getConditions();

		List<ConDiscreditCount> conDiscreditCount = new ArrayList<>();
		// 解释JSONArray
		JSONArray jarr = JSONArray.parseArray(conditions);
		for (Iterator iterator = jarr.iterator(); iterator.hasNext();) {
			ConDiscreditCount con = new ConDiscreditCount();
			JSONObject job = (JSONObject) iterator.next();
			String calcDimType = job.get("calcDimType").toString();
			con.setCalcDimType(calcDimType);
			log.info("calcDimType:" + calcDimType);
			String calcDimTypeValue = job.get("calcDimTypeValue").toString();
			con.setCalcDimTypeValue(calcDimTypeValue);
			log.info("calcDimTypeValue:" + calcDimTypeValue);
			String calcType = job.get("calcType").toString();
			con.setCalcType(calcType);
			log.info("calcType:" + calcType);
			String result = job.get("result").toString();
			con.setResult(result);
			log.info("result:" + result);
			String hits = job.get("hits").toString();
			log.info("hits:" + hits);
			String types = job.get("type").toString();
			con.setType(types);
			log.info("types:" + types);
			log.info("/////////////////////////////////////////////////");
			JSONArray hitsJarr = JSONArray.parseArray(hits);
			List<HitsDiscreditCount> discreditCount = new ArrayList<>();
			for (Iterator iteratorHit = hitsJarr.iterator(); iteratorHit.hasNext();) {
				JSONObject jobHit = (JSONObject) iteratorHit.next();
				Map<String, Object> key = jobHit;
				Object[] keys = key.keySet().toArray();
				// 初始化
				HitsDiscreditCount hit = forDiscreditCount(jobHit, keys);
				discreditCount.add(hit);
			}
			con.setHits(discreditCount);
			conDiscreditCount.add(con);
		}
		return conDiscreditCount;
	}

	// 当type为discredit_count时
	@Override
	public List<ConGreyList> parsHitsGreyList(TdHitsInformation entity) {
		String conditions = entity.getConditions();

		List<ConGreyList> conGreyList = new ArrayList<>();
		// 解释JSONArray
		JSONArray jarr = JSONArray.parseArray(conditions);
		for (Iterator iterator = jarr.iterator(); iterator.hasNext();) {
			ConGreyList con = new ConGreyList();
			JSONObject job = (JSONObject) iterator.next();
			String dimType = job.get("dimType").toString();
			con.setDimType(dimType);
			log.info("dimType:" + dimType);
			String dimValue = job.get("dimValue").toString();
			con.setDimValue(dimValue);
			log.info("dimValue:" + dimValue);
			String hits = job.get("hits").toString();
			log.info("hits:" + hits);
			String types = job.get("type").toString();
			con.setType(types);
			log.info("types:" + types);
			log.info("/////////////////////////////////////////////////");
			JSONArray hitsJarr = JSONArray.parseArray(hits);
			List<HitsGreyList> hitsGreyList = new ArrayList<>();
			for (Iterator iteratorHit = hitsJarr.iterator(); iteratorHit.hasNext();) {
				JSONObject jobHit = (JSONObject) iteratorHit.next();
				Map<String, Object> key = jobHit;
				Object[] keys = key.keySet().toArray();
				// 初始化
				HitsGreyList hit = forHitsGreyList(jobHit, keys);
				hitsGreyList.add(hit);
			}
			con.setHits(hitsGreyList);
			conGreyList.add(con);
		}
		return conGreyList;
	}

	// 当type为fuzzy_black_list时
	@Override
	public List<ConFuzzyBlackList> parsFuzzyBlackList(TdHitsInformation entity) {
		String conditions = entity.getConditions();

		List<ConFuzzyBlackList> conFuzzyBlackList = new ArrayList<>();
		// 解释JSONArray
		JSONArray jarr = JSONArray.parseArray(conditions);
		for (Iterator iterator = jarr.iterator(); iterator.hasNext();) {
			ConFuzzyBlackList con = new ConFuzzyBlackList();
			JSONObject job = (JSONObject) iterator.next();
			String hits = job.get("hits").toString();
			log.info("hits:" + hits);
			String types = job.get("type").toString();
			con.setType(types);
			log.info("types:" + types);
			log.info("/////////////////////////////////////////////////");
			JSONArray hitsJarr = JSONArray.parseArray(hits);
			List<HitsFuzzyBlackList> hitsFuzzyBlackList = new ArrayList<>();
			for (Iterator iteratorHit = hitsJarr.iterator(); iteratorHit.hasNext();) {
				JSONObject jobHit = (JSONObject) iteratorHit.next();
				Map<String, Object> key = jobHit;
				Object[] keys = key.keySet().toArray();
				// 初始化
				HitsFuzzyBlackList hit = forHitsFuzzyBlackList(jobHit, keys);
				hitsFuzzyBlackList.add(hit);
			}
			con.setHits(hitsFuzzyBlackList);
			conFuzzyBlackList.add(con);
		}
		return conFuzzyBlackList;
	}

	// 当type为frequency_distinct时
	@Override
	public List<ConFrequencyDistinct> parsFrequencyDistinct(TdHitsInformation entity) {
		String conditions = entity.getConditions();

		List<ConFrequencyDistinct> conFrequencyDistinct = new ArrayList<>();
		// 解释JSONArray
		JSONArray jarr = JSONArray.parseArray(conditions);
		for (Iterator iterator = jarr.iterator(); iterator.hasNext();) {
			ConFrequencyDistinct con = new ConFrequencyDistinct();
			JSONObject job = (JSONObject) iterator.next();
			String dimType = job.get("dimType").toString();
			con.setDimType(dimType);
			log.info("dimType:" + dimType);
			String dimValue = job.get("dimValue").toString();
			con.setDimValue(dimValue);
			log.info("dimValue:" + dimValue);
			String subDimType = job.get("subDimType").toString();
			con.setSubDimType(subDimType);
			log.info("subDimType:" + subDimType);
			String result = job.get("result").toString();
			con.setResult(result);
			log.info("result:" + result);
			String list = job.get("list").toString();
			log.info("list:" + list);
			String types = job.get("type").toString();
			con.setType(types);
			log.info("types:" + types);
			log.info("/////////////////////////////////////////////////");
			JSONArray listJarr = JSONArray.parseArray(list);
			List<String> frequencyDistinct = new ArrayList<>();
			Object[] arr = listJarr.toArray();
			for (int i = 0; i < arr.length; i++) {
				String arrValue = arr[i].toString();
				frequencyDistinct.add(arrValue);
			}
			con.setList(frequencyDistinct);
			conFrequencyDistinct.add(con);
		}
		return conFrequencyDistinct;
	}

	// 当type为cross_velocity_one_dim时
	@Override
	public List<ConCrossVelocityOneDim> parsCrossVelocityOneDim(TdHitsInformation entity) {
		String conditions = entity.getConditions();

		List<ConCrossVelocityOneDim> conCrossVelocityOneDim = new ArrayList<>();
		// 解释JSONArray
		JSONArray jarr = JSONArray.parseArray(conditions);
		for (Iterator iterator = jarr.iterator(); iterator.hasNext();) {
			ConCrossVelocityOneDim con = new ConCrossVelocityOneDim();
			JSONObject job = (JSONObject) iterator.next();
			String dimType = job.get("dimType").toString();
			con.setDimType(dimType);
			log.info("dimType:" + dimType);
			String dimValue = job.get("dimValue").toString();
			con.setDimValue(dimValue);
			log.info("dimValue:" + dimValue);
			String matchDimType = job.get("matchDimType").toString();
			con.setMatchDimType(matchDimType);
			log.info("matchDimType:" + matchDimType);
			String result = job.get("result").toString();
			con.setResult(result);
			log.info("result:" + result);
			String types = job.get("type").toString();
			con.setType(types);
			log.info("types:" + types);
			log.info("/////////////////////////////////////////////////");
			conCrossVelocityOneDim.add(con);
		}
		return conCrossVelocityOneDim;
	}

	// 当type为association_partner时
	@Override
	public List<ConAssociationPartner> parsAssociationPartner(TdHitsInformation entity) {
		String conditions = entity.getConditions();

		List<ConAssociationPartner> conAssociationPartner = new ArrayList<>();
		// 解释JSONArray
		JSONArray jarr = JSONArray.parseArray(conditions);
		for (Iterator iterator = jarr.iterator(); iterator.hasNext();) {
			ConAssociationPartner con = new ConAssociationPartner();
			JSONObject job = (JSONObject) iterator.next();
			String result = job.get("result").toString();
			con.setResult(result);
			log.info("result:" + result);
			String hits = job.get("hits").toString();
			log.info("hits:" + hits);
			String resultsForDim = job.get("resultsForDim").toString();
			log.info("resultsForDim" + resultsForDim);
			String hitsForDim = job.get("hitsForDim").toString();
			log.info("hitsForDim:" + hitsForDim);
			String types = job.get("type").toString();
			con.setType(types);
			log.info("types:" + types);
			log.info("/////////////////////////////////////////////////");
			JSONArray hitsJarr = JSONArray.parseArray(hits);
			List<HitsAssociationPartner> hitsAssociationPartner = new ArrayList<>();
			for (Iterator iteratorHit = hitsJarr.iterator(); iteratorHit.hasNext();) {
				JSONObject jobHit = (JSONObject) iteratorHit.next();
				Map<String, Object> key = jobHit;
				Object[] keys = key.keySet().toArray();
				// 初始化
				HitsAssociationPartner hit = forHitsAssociationPartner(jobHit, keys);
				hitsAssociationPartner.add(hit);
			}
			JSONArray resultsForDimJarr = JSONArray.parseArray(resultsForDim);
			List<HitsResultsForDim> resultsForDims = new ArrayList<>();
			for (Iterator iteratorHit = resultsForDimJarr.iterator(); iteratorHit.hasNext();) {
				JSONObject jobHit = (JSONObject) iteratorHit.next();
				Map<String, Object> key = jobHit;
				Object[] keys = key.keySet().toArray();
				// 初始化
				HitsResultsForDim hit = forResultsForDim(jobHit, keys);
				resultsForDims.add(hit);
			}
			JSONArray hitsForDimJarr = JSONArray.parseArray(hitsForDim);
			List<HitsForDim> HitsForDims = new ArrayList<>();
			for (Iterator iteratorHit = hitsForDimJarr.iterator(); iteratorHit.hasNext();) {
				JSONObject jobHit = (JSONObject) iteratorHit.next();
				Map<String, Object> key = jobHit;
				Object[] keys = key.keySet().toArray();
				// 初始化
				HitsForDim hit = forHitsForDim(jobHit, keys);
				HitsForDims.add(hit);
			}
			con.setHits(hitsAssociationPartner);
			con.setResultsForDim(resultsForDims);
			con.setHitsForDim(HitsForDims);
			conAssociationPartner.add(con);
		}
		return conAssociationPartner;
	}

	// 当type为frequency_one_dim时
	@Override
	public List<ConFrequencyOneDim> parsFrequencyOneDim(TdHitsInformation entity) {
		String conditions = entity.getConditions();

		List<ConFrequencyOneDim> conFrequencyOneDim = new ArrayList<>();
		// 解释JSONArray
		JSONArray jarr = JSONArray.parseArray(conditions);
		for (Iterator iterator = jarr.iterator(); iterator.hasNext();) {
			ConFrequencyOneDim con = new ConFrequencyOneDim();
			JSONObject job = (JSONObject) iterator.next();
			String dimType = job.get("dimType").toString();
			con.setDimType(dimType);
			log.info("dimType:" + dimType);
			String dimValue = job.get("dimValue").toString();
			con.setDimValue(dimValue);
			log.info("dimValue:" + dimValue);
			String result = job.get("result").toString();
			con.setResult(result);
			log.info("result:" + result);
			String types = job.get("type").toString();
			con.setType(types);
			log.info("types:" + types);
			log.info("/////////////////////////////////////////////////");
			conFrequencyOneDim.add(con);
		}
		return conFrequencyOneDim;
	}

	// 当type为frequency_one_dim时
	@Override
	public List<ConFrequencyCount> parsFrequencyCount(TdHitsInformation entity) {
		String conditions = entity.getConditions();

		List<ConFrequencyCount> conFrequencyCount = new ArrayList<>();
		// 解释JSONArray
		JSONArray jarr = JSONArray.parseArray(conditions);
		for (Iterator iterator = jarr.iterator(); iterator.hasNext();) {
			ConFrequencyCount con = new ConFrequencyCount();
			JSONObject job = (JSONObject) iterator.next();
			String dimType = job.get("dimType").toString();
			con.setDimType(dimType);
			log.info("dimType:" + dimType);
			String dimValue = job.get("dimValue").toString();
			con.setDimValue(dimValue);
			log.info("dimValue:" + dimValue);
			String subDimType = job.get("subDimType").toString();
			con.setSubDimType(subDimType);
			log.info("subDimType:" + subDimType);
			String result = job.get("result").toString();
			con.setResult(result);
			log.info("result:" + result);
			String types = job.get("type").toString();
			con.setType(types);
			log.info("types:" + types);
			log.info("/////////////////////////////////////////////////");
			conFrequencyCount.add(con);
		}
		return conFrequencyCount;
	}

	// 当type为fp_exception时
	@Override
	public List<ConFpException> parsFpException(TdHitsInformation entity) {
		String conditions = entity.getConditions();

		List<ConFpException> conFpException = new ArrayList<>();
		// 解释JSONArray
		JSONArray jarr = JSONArray.parseArray(conditions);
		for (Iterator iterator = jarr.iterator(); iterator.hasNext();) {
			ConFpException con = new ConFpException();
			JSONObject job = (JSONObject) iterator.next();
			String code = job.get("code").toString();
			con.setCode(code);
			log.info("code:" + code);
			String codeDisplayName = job.get("codeDisplayName").toString();
			con.setCodeDisplayName(codeDisplayName);
			log.info("codeDisplayName:" + codeDisplayName);
			String types = job.get("type").toString();
			con.setType(types);
			log.info("types:" + types);
			log.info("/////////////////////////////////////////////////");
			conFpException.add(con);
		}
		return conFpException;
	}

	// 当type为geo_ip_distance时
	@Override
	public List<ConGeoIpDistance> parsGeoIpDistance(TdHitsInformation entity) {
		String conditions = entity.getConditions();

		List<ConGeoIpDistance> conGeoIpDistance = new ArrayList<>();
		// 解释JSONArray
		JSONArray jarr = JSONArray.parseArray(conditions);
		for (Iterator iterator = jarr.iterator(); iterator.hasNext();) {
			ConGeoIpDistance con = new ConGeoIpDistance();
			JSONObject job = (JSONObject) iterator.next();
			String dimType = job.get("dimType").toString();
			con.setDimType(dimType);
			log.info("dimType:" + dimType);
			String dimValue = job.get("dimValue").toString();
			con.setDimValue(dimValue);
			log.info("dimValue:" + dimValue);
			String result = job.get("result").toString();
			con.setResult(result);
			log.info("result:" + result);
			String unit = job.get("unit").toString();
			con.setUnit(unit);
			log.info("unit:" + unit);
			String types = job.get("type").toString();
			con.setType(types);
			log.info("types:" + types);
			log.info("/////////////////////////////////////////////////");
			conGeoIpDistance.add(con);
		}
		return conGeoIpDistance;
	}

	// 当type为proxy_ip时
	@Override
	public List<ConProxyIp> parsProxyIp(TdHitsInformation entity) {
		String conditions = entity.getConditions();

		List<ConProxyIp> conProxyIp = new ArrayList<>();
		// 解释JSONArray
		JSONArray jarr = JSONArray.parseArray(conditions);
		for (Iterator iterator = jarr.iterator(); iterator.hasNext();) {
			ConProxyIp con = new ConProxyIp();
			JSONObject job = (JSONObject) iterator.next();
			String proxyIpType = job.get("proxyIpType").toString();
			con.setProxyIpType(proxyIpType);
			log.info("proxyIpType:" + proxyIpType);
			String types = job.get("type").toString();
			con.setType(types);
			log.info("types:" + types);
			log.info("/////////////////////////////////////////////////");
			conProxyIp.add(con);
		}
		return conProxyIp;
	}

	// 当type为match_address时
	@Override
	public List<ConMatchAddress> parsMatchAddress(TdHitsInformation entity) {
		String conditions = entity.getConditions();

		List<ConMatchAddress> conMatchAddress = new ArrayList<>();
		// 解释JSONArray
		JSONArray jarr = JSONArray.parseArray(conditions);
		for (Iterator iterator = jarr.iterator(); iterator.hasNext();) {
			ConMatchAddress con = new ConMatchAddress();
			JSONObject job = (JSONObject) iterator.next();
			String addressA = job.get("addressA").toString();
			con.setAddressA(addressA);
			log.info("addressA:" + addressA);
			String addressAValue = job.get("addressAValue").toString();
			con.setAddressAValue(addressAValue);
			log.info("addressAValue:" + addressAValue);
			String addressB = job.get("addressB").toString();
			con.setAddressB(addressB);
			log.info("addressB:" + addressB);
			String addressBValue = job.get("addressBValue").toString();
			con.setAddressBValue(addressBValue);
			log.info("addressBValue:" + addressBValue);
			String types = job.get("type").toString();
			con.setType(types);
			log.info("types:" + types);
			log.info("/////////////////////////////////////////////////");
			conMatchAddress.add(con);
		}
		return conMatchAddress;
	}

	// 当type为gps_distance时
	@Override
	public List<ConGpsDistance> parsGpsDistance(TdHitsInformation entity) {
		String conditions = entity.getConditions();

		List<ConGpsDistance> conGpsDistance = new ArrayList<>();
		// 解释JSONArray
		JSONArray jarr = JSONArray.parseArray(conditions);
		for (Iterator iterator = jarr.iterator(); iterator.hasNext();) {
			ConGpsDistance con = new ConGpsDistance();
			JSONObject job = (JSONObject) iterator.next();
			String gpsA = job.get("gpsA").toString();
			con.setGpsA(gpsA);
			log.info("gpsA:" + gpsA);
			String gpsB = job.get("gpsB").toString();
			con.setGpsB(gpsB);
			log.info("gpsB:" + gpsB);
			String result = job.get("result").toString();
			con.setResult(result);
			log.info("result:" + result);
			String unit = job.get("unit").toString();
			con.setUnit(unit);
			log.info("unit:" + unit);
			String types = job.get("type").toString();
			con.setType(types);
			log.info("types:" + types);
			log.info("/////////////////////////////////////////////////");
			conGpsDistance.add(con);
		}
		return conGpsDistance;
	}

	// 当type为regex时
	@Override
	public List<ConRegex> parsRegex(TdHitsInformation entity) {
		String conditions = entity.getConditions();

		List<ConRegex> conRegex = new ArrayList<>();
		// 解释JSONArray
		JSONArray jarr = JSONArray.parseArray(conditions);
		for (Iterator iterator = jarr.iterator(); iterator.hasNext();) {
			ConRegex con = new ConRegex();
			JSONObject job = (JSONObject) iterator.next();
			String dimType = job.get("dimType").toString();
			con.setDimType(dimType);
			log.info("dimType:" + dimType);
			String value = job.get("value").toString();
			con.setValue(value);
			log.info("value:" + value);
			String types = job.get("type").toString();
			con.setType(types);
			log.info("types:" + types);
			log.info("/////////////////////////////////////////////////");
			conRegex.add(con);
		}
		return conRegex;
	}

	// 当type为event_time_diff时
	@Override
	public List<ConEventTimeDiff> parsEventTimeDiff(TdHitsInformation entity) {
		String conditions = entity.getConditions();

		List<ConEventTimeDiff> conEventTimeDiff = new ArrayList<>();
		// 解释JSONArray
		JSONArray jarr = JSONArray.parseArray(conditions);
		for (Iterator iterator = jarr.iterator(); iterator.hasNext();) {
			ConEventTimeDiff con = new ConEventTimeDiff();
			JSONObject job = (JSONObject) iterator.next();
			String dimType = job.get("dimType").toString();
			con.setDimType(dimType);
			log.info("dimType:" + dimType);
			String dimValue = job.get("dimValue").toString();
			con.setDimValue(dimValue);
			log.info("dimValue:" + dimValue);
			String result = job.get("result").toString();
			con.setResult(result);
			log.info("result:" + result);
			String diffDisplay = job.get("diffDisplay").toString();
			con.setDiffDisplay(diffDisplay);
			log.info("diffDisplay:" + diffDisplay);
			String types = job.get("type").toString();
			con.setType(types);
			log.info("types:" + types);
			log.info("/////////////////////////////////////////////////");
			conEventTimeDiff.add(con);
		}
		return conEventTimeDiff;
	}

	// 当type为time_diff时
	@Override
	public List<ConTimeDiff> parsTimeDiff(TdHitsInformation entity) {
		String conditions = entity.getConditions();

		List<ConTimeDiff> conTimeDiff = new ArrayList<>();
		// 解释JSONArray
		JSONArray jarr = JSONArray.parseArray(conditions);
		for (Iterator iterator = jarr.iterator(); iterator.hasNext();) {
			ConTimeDiff con = new ConTimeDiff();
			JSONObject job = (JSONObject) iterator.next();
			String diffDisplay = job.get("diffDisplay").toString();
			con.setDiffDisplay(diffDisplay);
			log.info("diffDisplay:" + diffDisplay);
			String result = job.get("result").toString();
			con.setResult(result);
			log.info("result:" + result);
			String types = job.get("type").toString();
			con.setType(types);
			log.info("types:" + types);
			log.info("/////////////////////////////////////////////////");
			conTimeDiff.add(con);
		}
		return conTimeDiff;
	}

	// 当type为active_days_one时
	@Override
	public List<ConActiveDaysOne> parsActiveDaysOne(TdHitsInformation entity) {
		String conditions = entity.getConditions();
		
		List<ConActiveDaysOne> conActiveDaysOne = new ArrayList<>();
		// 解释JSONArray
		JSONArray jarr = JSONArray.parseArray(conditions);
		for (Iterator iterator = jarr.iterator(); iterator.hasNext();) {
			ConActiveDaysOne con = new ConActiveDaysOne();
			JSONObject job = (JSONObject) iterator.next();
			String dimType = job.get("dimType").toString();
			con.setDimType(dimType);
			log.info("dimType:" + dimType);
			String dimValue = job.get("dimValue").toString();
			con.setDimValue(dimValue);
			log.info("dimValue:" + dimValue);
			String result = job.get("result").toString();
			con.setResult(result);
			log.info("result:" + result);
			String types = job.get("type").toString();
			con.setType(types);
			log.info("types:" + types);
			log.info("/////////////////////////////////////////////////");
			conActiveDaysOne.add(con);
		}
		return conActiveDaysOne;
	}

	// 当type为active_days_two时
	@Override
	public List<ConActiveDaysTwo> parsActiveDaysTwo(TdHitsInformation entity) {
		String conditions = entity.getConditions();
		
		List<ConActiveDaysTwo> conActiveDaysTwo = new ArrayList<>();
		// 解释JSONArray
		JSONArray jarr = JSONArray.parseArray(conditions);
		for (Iterator iterator = jarr.iterator(); iterator.hasNext();) {
			ConActiveDaysTwo con = new ConActiveDaysTwo();
			JSONObject job = (JSONObject) iterator.next();
			String dimType = job.get("dimType").toString();
			con.setDimType(dimType);
			log.info("dimType:" + dimType);
			String dimValue = job.get("dimValue").toString();
			con.setDimValue(dimValue);
			log.info("dimValue:" + dimValue);
			String subDimType = job.get("subDimType").toString();
			con.setSubDimType(subDimType);
			log.info("subDimType:" + subDimType);
			String result = job.get("result").toString();
			con.setResult(result);
			log.info("result:" + result);
			String types = job.get("type").toString();
			con.setType(types);
			log.info("types:" + types);
			log.info("/////////////////////////////////////////////////");
			conActiveDaysTwo.add(con);
		}
		return conActiveDaysTwo;
	}

	// 当type为cross_event时
	@Override
	public List<ConCrossEvent> parsCrossEvent(TdHitsInformation entity) {
		String conditions = entity.getConditions();

		List<ConCrossEvent> conCrossEvent = new ArrayList<>();
		// 解释JSONArray
		JSONArray jarr = JSONArray.parseArray(conditions);
		for (Iterator iterator = jarr.iterator(); iterator.hasNext();) {
			ConCrossEvent con = new ConCrossEvent();
			JSONObject job = (JSONObject) iterator.next();
			String dimType = job.get("dimType").toString();
			con.setDimType(dimType);
			log.info("dimType:" + dimType);
			String matchDimType = job.get("matchDimType").toString();
			con.setMatchDimType(matchDimType);
			log.info("matchDimType:" + matchDimType);
			String dimValue = job.get("dimValue").toString();
			con.setDimValue(dimValue);
			log.info("dimValue:" + dimValue);
			String subDimType = job.get("subDimType").toString();
			con.setSubDimType(subDimType);
			log.info("subDimType:" + subDimType);
			String result = job.get("result").toString();
			con.setResult(result);
			log.info("result:" + result);
			String types = job.get("type").toString();
			con.setType(types);
			log.info("types:" + types);
			log.info("/////////////////////////////////////////////////");
			conCrossEvent.add(con);
		}
		return conCrossEvent;
	}

	// 当type为cross_velocity_distinct时
	@Override
	public List<ConCrossVelocityDistinct> parsCrossVelocityDistinct(TdHitsInformation entity) {
		String conditions = entity.getConditions();

		List<ConCrossVelocityDistinct> conCrossVelocityDistinct = new ArrayList<>();
		// 解释JSONArray
		JSONArray jarr = JSONArray.parseArray(conditions);
		for (Iterator iterator = jarr.iterator(); iterator.hasNext();) {
			ConCrossVelocityDistinct con = new ConCrossVelocityDistinct();
			JSONObject job = (JSONObject) iterator.next();
			String dimType = job.get("dimType").toString();
			con.setDimType(dimType);
			log.info("dimType:" + dimType);
			String matchDimType = job.get("matchDimType").toString();
			con.setMatchDimType(matchDimType);
			log.info("matchDimType:" + matchDimType);
			String dimValue = job.get("dimValue").toString();
			con.setDimValue(dimValue);
			log.info("dimValue:" + dimValue);
			String subDimType = job.get("subDimType").toString();
			con.setSubDimType(subDimType);
			log.info("subDimType:" + subDimType);
			String result = job.get("result").toString();
			con.setResult(result);
			String list = job.get("list").toString();
			log.info("list:" + list);
			log.info("result:" + result);
			String types = job.get("type").toString();
			con.setType(types);
			log.info("types:" + types);
			log.info("/////////////////////////////////////////////////");
			JSONArray listJarr = JSONArray.parseArray(list);
			List<String> crossVelocityDistinct = new ArrayList<>();
			Object[] arr = listJarr.toArray();
			for (int i = 0; i < arr.length; i++) {
				String arrValue = arr[i].toString();
				crossVelocityDistinct.add(arrValue);
			}
			con.setList(crossVelocityDistinct);
			conCrossVelocityDistinct.add(con);
		}
		return conCrossVelocityDistinct;
	}

	// 当type为calculate时
	@Override
	public List<ConCalculate> parsCalculate(TdHitsInformation entity) {
		String conditions = entity.getConditions();

		List<ConCalculate> conCalculate = new ArrayList<>();
		// 解释JSONArray
		JSONArray jarr = JSONArray.parseArray(conditions);
		for (Iterator iterator = jarr.iterator(); iterator.hasNext();) {
			ConCalculate con = new ConCalculate();
			JSONObject job = (JSONObject) iterator.next();
			String dimType = job.get("dimType").toString();
			con.setDimType(dimType);
			log.info("dimType:" + dimType);
			String calcType = job.get("calcType").toString();
			con.setCalcType(calcType);
			log.info("calcType:" + calcType);
			String dimValue = job.get("dimValue").toString();
			con.setDimValue(dimValue);
			log.info("dimValue:" + dimValue);
			String subDimType = job.get("subDimType").toString();
			con.setSubDimType(subDimType);
			log.info("subDimType:" + subDimType);
			String result = job.get("result").toString();
			con.setResult(result);
			log.info("result:" + result);
			String types = job.get("type").toString();
			con.setType(types);
			log.info("types:" + types);
			log.info("/////////////////////////////////////////////////");
			conCalculate.add(con);
		}
		return conCalculate;
	}

	// 当type为last_match时
	@Override
	public List<ConLastMatch> parsLastMatch(TdHitsInformation entity) {
		String conditions = entity.getConditions();

		List<ConLastMatch> conLastMatch = new ArrayList<>();
		// 解释JSONArray
		JSONArray jarr = JSONArray.parseArray(conditions);
		for (Iterator iterator = jarr.iterator(); iterator.hasNext();) {
			ConLastMatch con = new ConLastMatch();
			JSONObject job = (JSONObject) iterator.next();
			String dimType = job.get("dimType").toString();
			con.setDimType(dimType);
			log.info("dimType:" + dimType);
			String dimValue = job.get("dimValue").toString();
			con.setDimValue(dimValue);
			log.info("dimValue:" + dimValue);
			String result = job.get("result").toString();
			con.setResult(result);
			log.info("result:" + result);
			String types = job.get("type").toString();
			con.setType(types);
			log.info("types:" + types);
			log.info("/////////////////////////////////////////////////");
			conLastMatch.add(con);
		}
		return conLastMatch;
	}

	// 当type为count时
	@Override
	public List<ConCount> parsCount(TdHitsInformation entity) {
		String conditions = entity.getConditions();

		List<ConCount> conCount = new ArrayList<>();
		// 解释JSONArray
		JSONArray jarr = JSONArray.parseArray(conditions);
		for (Iterator iterator = jarr.iterator(); iterator.hasNext();) {
			ConCount con = new ConCount();
			JSONObject job = (JSONObject) iterator.next();
			String dimType = job.get("dimType").toString();
			con.setDimType(dimType);
			log.info("dimType:" + dimType);
			String dimValue = job.get("dimValue").toString();
			con.setDimValue(dimValue);
			log.info("dimValue:" + dimValue);
			String subDimType = job.get("subDimType").toString();
			con.setSubDimType(subDimType);
			log.info("subDimType:" + subDimType);
			String result = job.get("result").toString();
			con.setResult(result);
			log.info("result:" + result);
			String types = job.get("type").toString();
			con.setType(types);
			log.info("types:" + types);
			log.info("/////////////////////////////////////////////////");
			conCount.add(con);
		}
		return conCount;
	}

	// 当type为association_industry时
	@Override
	public List<ConAssociationIndustry> parsAssociationIndustry(TdHitsInformation entity) {
		String conditions = entity.getConditions();

		List<ConAssociationIndustry> conAssociationIndustry = new ArrayList<>();
		// 解释JSONArray
		JSONArray jarr = JSONArray.parseArray(conditions);
		for (Iterator iterator = jarr.iterator(); iterator.hasNext();) {
			ConAssociationIndustry con = new ConAssociationIndustry();
			JSONObject job = (JSONObject) iterator.next();
			String result = job.get("result").toString();
			con.setResult(result);
			log.info("result:" + result);
			String resultsForDim = job.get("resultsForDim").toString();
			log.info("resultsForDim:" + resultsForDim);
			String list = job.get("list").toString();
			log.info("list:" + list);
			String types = job.get("type").toString();
			con.setType(types);
			log.info("types:" + types);
			log.info("/////////////////////////////////////////////////");
			JSONArray listJarr = JSONArray.parseArray(list);
			List<String> assList = new ArrayList<>();
			Object[] arr = listJarr.toArray();
			for (int i = 0; i < arr.length; i++) {
				String arrValue = arr[i].toString();
				assList.add(arrValue);
			}
			JSONArray resultsForDimJarr = JSONArray.parseArray(resultsForDim);
			List<HitsAssResultsForDim> hitsResultsForDim = new ArrayList<>();
			for (Iterator iteratorHit = resultsForDimJarr.iterator(); iteratorHit.hasNext();) {
				JSONObject jobHit = (JSONObject) iteratorHit.next();
				Map<String, Object> key = jobHit;
				Object[] keys = key.keySet().toArray();
				// 初始化
				HitsAssResultsForDim hit = forAssResultsForDim(jobHit, keys);
				hitsResultsForDim.add(hit);
			}
			con.setList(assList);
			con.setResultsForDim(hitsResultsForDim);

			conAssociationIndustry.add(con);
		}
		return conAssociationIndustry;
	}

	// 当type为cross_partner时
	@Override
	public List<ConCrossPartner> parsCrossPartner(TdHitsInformation entity) {
		String conditions = entity.getConditions();

		List<ConCrossPartner> conCrossPartner = new ArrayList<>();
		// 解释JSONArray
		JSONArray jarr = JSONArray.parseArray(conditions);
		for (Iterator iterator = jarr.iterator(); iterator.hasNext();) {
			ConCrossPartner con = new ConCrossPartner();
			JSONObject job = (JSONObject) iterator.next();
			String result = job.get("result").toString();
			con.setResult(result);
			log.info("result:" + result);
			String eventType = job.get("eventType").toString();
			con.setEventType(eventType);
			log.info("eventType:" + eventType);
			String resultsForDim = job.get("resultsForDim").toString();
			log.info("resultsForDim:" + resultsForDim);
			String hits = job.get("hits").toString();
			log.info("hits:" + hits);
			String hitsForDim = job.get("hitsForDim").toString();
			log.info("hitsForDim:" + hitsForDim);
			String types = job.get("type").toString();
			con.setType(types);
			log.info("types:" + types);
			log.info("/////////////////////////////////////////////////");
			JSONArray resultsForDimJarr = JSONArray.parseArray(resultsForDim);
			List<HitsResultsForDimCross> hitsResultsForDim = new ArrayList<>();
			for (Iterator iteratorHit = resultsForDimJarr.iterator(); iteratorHit.hasNext();) {
				JSONObject jobHit = (JSONObject) iteratorHit.next();
				Map<String, Object> key = jobHit;
				Object[] keys = key.keySet().toArray();
				// 初始化
				HitsResultsForDimCross hit = forResultsForDimCross(jobHit, keys);
				hitsResultsForDim.add(hit);
			}
			JSONArray hitsJarr = JSONArray.parseArray(hits);
			List<HitsCrossPartner> hitsCrossPartner = new ArrayList<>();
			for (Iterator iteratorHit = hitsJarr.iterator(); iteratorHit.hasNext();) {
				JSONObject jobHit = (JSONObject) iteratorHit.next();
				Map<String, Object> key = jobHit;
				Object[] keys = key.keySet().toArray();
				// 初始化
				HitsCrossPartner hit = forCrossPartner(jobHit, keys);
				hitsCrossPartner.add(hit);
			}
			JSONArray hitsForDimJarr = JSONArray.parseArray(hitsForDim);
			List<HitsForDimCross> hitsForDimCross = new ArrayList<>();
			for (Iterator iteratorHit = hitsForDimJarr.iterator(); iteratorHit.hasNext();) {
				JSONObject jobHit = (JSONObject) iteratorHit.next();
				Map<String, Object> key = jobHit;
				Object[] keys = key.keySet().toArray();
				// 初始化
				HitsForDimCross hit = forHitsForDimCross(jobHit, keys);
				hitsForDimCross.add(hit);
			}
			con.setResultsForDim(hitsResultsForDim);
			con.setHits(hitsCrossPartner);
			con.setHitsForDim(hitsForDimCross);

			conCrossPartner.add(con);
		}
		return conCrossPartner;
	}

	// 当type为four_calculation和function_kit时
	@Override
	public List<ConFourCalculation> parsFourCalculation(TdHitsInformation entity) {
		String conditions = entity.getConditions();

		List<ConFourCalculation> conFourCalculation = new ArrayList<>();
		// 解释JSONArray
		JSONArray jarr = JSONArray.parseArray(conditions);
		for (Iterator iterator = jarr.iterator(); iterator.hasNext();) {
			ConFourCalculation con = new ConFourCalculation();
			JSONObject job = (JSONObject) iterator.next();
			String result = job.get("result").toString();
			con.setResult(result);
			log.info("result:" + result);
			String types = job.get("type").toString();
			con.setType(types);
			log.info("types:" + types);
			log.info("/////////////////////////////////////////////////");
			conFourCalculation.add(con);
		}
		return conFourCalculation;
	}

	// 当type为usual_browser时
	@Override
	public List<ConUsualBrowser> parsUsualBrowser(TdHitsInformation entity) {
		String conditions = entity.getConditions();

		List<ConUsualBrowser> conUsualBrowser = new ArrayList<>();
		// 解释JSONArray
		JSONArray jarr = JSONArray.parseArray(conditions);
		for (Iterator iterator = jarr.iterator(); iterator.hasNext();) {
			ConUsualBrowser con = new ConUsualBrowser();
			JSONObject job = (JSONObject) iterator.next();
			String dimType = job.get("dimType").toString();
			con.setDimType(dimType);
			log.info("dimType:" + dimType);
			String dimValue = job.get("dimValue").toString();
			con.setDimValue(dimValue);
			log.info("dimValue:" + dimValue);
			String result = job.get("result").toString();
			con.setResult(result);
			log.info("result:" + result);
			String unit = job.get("unit").toString();
			con.setUnit(unit);
			log.info("unit:" + unit);
			String unitDisplayName = job.get("unitDisplayName").toString();
			con.setUnitDisplayName(unitDisplayName);
			log.info("unitDisplayName:" + unitDisplayName);
			String types = job.get("type").toString();
			con.setType(types);
			log.info("types:" + types);
			log.info("/////////////////////////////////////////////////");
			conUsualBrowser.add(con);
		}
		return conUsualBrowser;
	}

	// 当type为keyword时
	@Override
	public List<ConKeyword> parsKeyword(TdHitsInformation entity) {
		String conditions = entity.getConditions();

		List<ConKeyword> conKeyword = new ArrayList<>();
		// 解释JSONArray
		JSONArray jarr = JSONArray.parseArray(conditions);
		for (Iterator iterator = jarr.iterator(); iterator.hasNext();) {
			ConKeyword con = new ConKeyword();
			JSONObject job = (JSONObject) iterator.next();
			String keyword = job.get("keyword").toString();
			con.setKeyword(keyword);
			log.info("keyword:" + keyword);
			String data = job.get("data").toString();
			log.info("data:" + data);
			String types = job.get("type").toString();
			con.setType(types);
			log.info("types:" + types);
			log.info("/////////////////////////////////////////////////");
			JSONArray dataJarr = JSONArray.parseArray(data);
			List<String> dataList = new ArrayList<>();
			Object[] arr = dataJarr.toArray();
			for (int i = 0; i < arr.length; i++) {
				String arrValue = arr[i].toString();
				dataList.add(arrValue);
			}
			con.setData(dataList);
			conKeyword.add(con);
		}
		return conKeyword;
	}

	// 当type为android_cheat_app时
	@Override
	public List<ConAndroidCheatApp> parsAndroidCheatApp(TdHitsInformation entity) {
		String conditions = entity.getConditions();

		List<ConAndroidCheatApp> conAndroidCheatApp = new ArrayList<>();
		// 解释JSONArray
		JSONArray jarr = JSONArray.parseArray(conditions);
		for (Iterator iterator = jarr.iterator(); iterator.hasNext();) {
			ConAndroidCheatApp con = new ConAndroidCheatApp();
			JSONObject job = (JSONObject) iterator.next();
			String hookMethod = job.get("hookMethod").toString();
			con.setHookMethod(hookMethod);
			log.info("hookMethod:" + hookMethod);
			String hookInline = job.get("hookInline").toString();
			con.setHookInline(hookInline);
			log.info("hookInline:" + hookInline);
			String hookAddress = job.get("hookAddress").toString();
			con.setHookAddress(hookAddress);
			log.info("hookAddress:" + hookAddress);
			String types = job.get("type").toString();
			con.setType(types);
			log.info("types:" + types);
			log.info("/////////////////////////////////////////////////");
			conAndroidCheatApp.add(con);
		}
		return conAndroidCheatApp;
	}

	// 当type为ios_cheat_app时
	@Override
	public List<ConIosCheatApp> parsIosCheatApp(TdHitsInformation entity) {
		String conditions = entity.getConditions();

		List<ConIosCheatApp> conIosCheatApp = new ArrayList<>();
		// 解释JSONArray
		JSONArray jarr = JSONArray.parseArray(conditions);
		for (Iterator iterator = jarr.iterator(); iterator.hasNext();) {
			ConIosCheatApp con = new ConIosCheatApp();
			JSONObject job = (JSONObject) iterator.next();
			String hookInline = job.get("hookInline").toString();
			con.setHookInline(hookInline);
			log.info("hookInline:" + hookInline);
			String hookIMP = job.get("hookIMP").toString();
			con.setHookIMP(hookIMP);
			log.info("hookInline:" + hookInline);
			String types = job.get("type").toString();
			con.setType(types);
			log.info("types:" + types);
			log.info("/////////////////////////////////////////////////");
			conIosCheatApp.add(con);
		}
		return conIosCheatApp;
	}

	// 当type为android_emulator时
	@Override
	public List<ConAndroidEmulator> parsAndroidEmulator(TdHitsInformation entity) {
		String conditions = entity.getConditions();

		List<ConAndroidEmulator> conAndroidEmulator = new ArrayList<>();
		// 解释JSONArray
		JSONArray jarr = JSONArray.parseArray(conditions);
		for (Iterator iterator = jarr.iterator(); iterator.hasNext();) {
			ConAndroidEmulator con = new ConAndroidEmulator();
			JSONObject job = (JSONObject) iterator.next();
			String emulatorType = job.get("emulatorType").toString();
			con.setEmulatorType(emulatorType);
			log.info("emulatorType:" + emulatorType);
			String types = job.get("type").toString();
			con.setType(types);
			log.info("types:" + types);
			log.info("/////////////////////////////////////////////////");
			conAndroidEmulator.add(con);
		}
		return conAndroidEmulator;
	}

	// 当type为device_status_abnormal时
	@Override
	public List<ConDeviceStatusAbnormal> parsDeviceStatusAbnormal(TdHitsInformation entity) {
		String conditions = entity.getConditions();

		List<ConDeviceStatusAbnormal> conDeviceStatusAbnormal = new ArrayList<>();
		// 解释JSONArray
		JSONArray jarr = JSONArray.parseArray(conditions);
		for (Iterator iterator = jarr.iterator(); iterator.hasNext();) {
			ConDeviceStatusAbnormal con = new ConDeviceStatusAbnormal();
			JSONObject job = (JSONObject) iterator.next();
			String abnormalTags = job.get("abnormalTags").toString();
			con.setAbnormalTags(abnormalTags);
			log.info("abnormalTags:" + abnormalTags);
			String types = job.get("type").toString();
			con.setType(types);
			log.info("types:" + types);
			log.info("/////////////////////////////////////////////////");
			conDeviceStatusAbnormal.add(con);
		}
		return conDeviceStatusAbnormal;
	}

	// 当type为suspected_team时
	@Override
	public List<ConSuspectedTeam> parsSuspectedTeam(TdHitsInformation entity) {
		String conditions = entity.getConditions();

		List<ConSuspectedTeam> conSuspectedTeam = new ArrayList<>();
		// 解释JSONArray
		JSONArray jarr = JSONArray.parseArray(conditions);
		for (Iterator iterator = jarr.iterator(); iterator.hasNext();) {
			ConSuspectedTeam con = new ConSuspectedTeam();
			JSONObject job = (JSONObject) iterator.next();
			String dimType = job.get("dimType").toString();
			con.setDimType(dimType);
			log.info("dimType:" + dimType);
			String dimValue = job.get("dimValue").toString();
			con.setDimValue(dimValue);
			log.info("dimValue:" + dimValue);
			String groupId = job.get("groupId").toString();
			con.setGroupId(groupId);
			log.info("groupId:" + groupId);
			String totalCnt = job.get("totalCnt").toString();
			con.setTotalCnt(totalCnt);
			log.info("totalCnt:" + totalCnt);
			String blackCnt = job.get("blackCnt").toString();
			con.setBlackCnt(blackCnt);
			log.info("blackCnt:" + blackCnt);
			String greyCnt = job.get("greyCnt").toString();
			con.setGreyCnt(greyCnt);
			log.info("greyCnt:" + greyCnt);
			String nodeDist = job.get("nodeDist").toString();
			con.setNodeDist(nodeDist);
			log.info("nodeDist:" + nodeDist);
			String fraudDist = job.get("fraudDist").toString();
			con.setFraudDist(fraudDist);
			log.info("fraudDist:" + fraudDist);
			String blackRat = job.get("blackRat").toString();
			con.setBlackRat(blackRat);
			log.info("blackRat:" + blackRat);
			String greyRat = job.get("greyRat").toString();
			con.setGreyRat(greyRat);
			log.info("greyRat:" + greyRat);
			String degree = job.get("degree").toString();
			con.setDegree(degree);
			log.info("degree:" + degree);
			String totalCntTwo = job.get("totalCntTwo").toString();
			con.setTotalCntTwo(totalCntTwo);
			log.info("totalCntTwo:" + totalCntTwo);
			String blackCntOne = job.get("blackCntOne").toString();
			con.setBlackCntOne(blackCntOne);
			log.info("blackCntOne:" + blackCntOne);
			String fraudDistOne = job.get("fraudDistOne").toString();
			con.setFraudDistOne(fraudDistOne);
			log.info("fraudDistOne:" + fraudDistOne);
			String blackCntTwo = job.get("blackCntTwo").toString();
			con.setBlackCntTwo(blackCntTwo);
			log.info("blackCntTwo:" + blackCntTwo);
			String fraudDistTwo = job.get("fraudDistTwo").toString();
			con.setFraudDistTwo(fraudDistTwo);
			log.info("fraudDistTwo:" + fraudDistTwo);
			String blackDst = job.get("blackDst").toString();
			con.setBlackDst(blackDst);
			log.info("blackDst:" + blackDst);
			String coreDst = job.get("coreDst").toString();
			con.setCoreDst(coreDst);
			log.info("coreDst:" + coreDst);
			String nodeDistJson = job.get("nodeDistJson").toString();
			con.setNodeDistJson(nodeDistJson);
			log.info("nodeDistJson:" + nodeDistJson);
			log.info("/////////////////////////////////////////////////");
			conSuspectedTeam.add(con);
		}
		return conSuspectedTeam;
	}

	// ---------------------------------------------------------------------------------------------

	public HitsBlackList forBlackList(JSONObject jobHit, Object[] keys) {
		HitsBlackList hit = new HitsBlackList();
		for (int i = 0; i < keys.length; i++) {
			if ("value".equals(keys[i])) {
				hit.setValue(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
			if ("fraudTypeDisplayName".equals(keys[i])) {
				hit.setFraudTypeDisplayName(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
			if ("executedName".equals(keys[i])) {
				hit.setExecutedName(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
			if ("age".equals(keys[i])) {
				hit.setAge(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
			if ("gender".equals(keys[i])) {
				hit.setGender(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
			if ("province".equals(keys[i])) {
				hit.setProvince(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
			if ("caseDate".equals(keys[i])) {
				hit.setCaseDate(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
			if ("executeCourt".equals(keys[i])) {
				hit.setExecuteCourt(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
			if ("executeSubject".equals(keys[i])) {
				hit.setExecuteSubject(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
			if ("executeStatus".equals(keys[i])) {
				hit.setExecuteStatus(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
			if ("evidenceCourt".equals(keys[i])) {
				hit.setEvidenceCourt(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
			if ("termDuty".equals(keys[i])) {
				hit.setTermDuty(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
			if ("carryOut".equals(keys[i])) {
				hit.setCarryOut(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
			if ("specificCircumstances".equals(keys[i])) {
				hit.setSpecificCircumstances(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
			if ("executeCode".equals(keys[i])) {
				hit.setExecuteCode(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
			if ("caseCode".equals(keys[i])) {
				hit.setCaseCode(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
			if ("evidenceTime".equals(keys[i])) {
				hit.setEvidenceTime(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
		}
		log.info("--------------------------------------");
		return hit;
	}

	public HitsDiscreditCount forDiscreditCount(JSONObject jobHit, Object[] keys) {
		HitsDiscreditCount hit = new HitsDiscreditCount();
		for (int i = 0; i < keys.length; i++) {
			if ("overdueAmount".equals(keys[i])) {
				hit.setOverdueAmount(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
				/*
				 * String Amount = jobHit.get(keys[i]).toString().substring(0,
				 * jobHit.get(keys[i]).toString().length()-1); String[]
				 * overdueAmount = Amount.split(",");
				 * hit.setOverdueAmount("大于"+overdueAmount[0]+",小于"+
				 * overdueAmount[1]); String value =
				 * "大于"+overdueAmount[0]+",小于"+overdueAmount[1];
				 * log.info(keys[i] + ":" + value);
				 */
			}
			if ("overdueCount".equals(keys[i])) {
				hit.setOverdueCount(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
			if ("overdueDay".equals(keys[i])) {
				hit.setOverdueDay(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
			if ("overdueTime".equals(keys[i])) {
				hit.setOverdueTime(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
		}
		log.info("--------------------------------------");
		return hit;
	}

	public HitsGreyList forHitsGreyList(JSONObject jobHit, Object[] keys) {
		HitsGreyList hit = new HitsGreyList();
		for (int i = 0; i < keys.length; i++) {
			if ("value".equals(keys[i])) {
				hit.setValue(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
			if ("riskLevelDisplayName".equals(keys[i])) {
				hit.setRiskLevelDisplayName(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
			if ("fraudTypeDisplayName".equals(keys[i])) {
				hit.setFraudTypeDisplayName(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
			if ("evidenceTime".equals(keys[i])) {
				hit.setEvidenceTime(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
		}
		log.info("--------------------------------------");
		return hit;
	}

	public HitsFuzzyBlackList forHitsFuzzyBlackList(JSONObject jobHit, Object[] keys) {
		HitsFuzzyBlackList hit = new HitsFuzzyBlackList();
		for (int i = 0; i < keys.length; i++) {
			if ("fuzzyIdNumber".equals(keys[i])) {
				hit.setFuzzyIdNumber(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
			if ("fuzzyName".equals(keys[i])) {
				hit.setFuzzyName(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
			if ("fraudTypeDisplayName".equals(keys[i])) {
				hit.setFraudTypeDisplayName(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
		}
		log.info("--------------------------------------");
		return hit;
	}

	public HitsAssociationPartner forHitsAssociationPartner(JSONObject jobHit, Object[] keys) {
		HitsAssociationPartner hit = new HitsAssociationPartner();
		for (int i = 0; i < keys.length; i++) {
			if ("industryDisplayName".equals(keys[i])) {
				hit.setIndustryDisplayName(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
			if ("count".equals(keys[i])) {
				hit.setCount(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
		}
		log.info("--------------------------------------");
		return hit;
	}

	public HitsResultsForDim forResultsForDim(JSONObject jobHit, Object[] keys) {
		HitsResultsForDim hit = new HitsResultsForDim();
		for (int i = 0; i < keys.length; i++) {
			if ("dimType".equals(keys[i])) {
				hit.setDimType(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
			if ("count".equals(keys[i])) {
				hit.setCount(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
		}
		log.info("--------------------------------------");
		return hit;
	}

	public HitsForDim forHitsForDim(JSONObject jobHit, Object[] keys) {
		HitsForDim hit = new HitsForDim();
		for (int i = 0; i < keys.length; i++) {
			if ("dimType".equals(keys[i])) {
				hit.setDimType(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
			if ("industryDisplayName".equals(keys[i])) {
				hit.setIndustryDisplayName(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
			if ("count".equals(keys[i])) {
				hit.setCount(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
		}
		log.info("--------------------------------------");
		return hit;
	}

	public HitsAssResultsForDim forAssResultsForDim(JSONObject jobHit, Object[] keys) {
		HitsAssResultsForDim hit = new HitsAssResultsForDim();
		for (int i = 0; i < keys.length; i++) {
			if ("dimType".equals(keys[i])) {
				hit.setDimType(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
			if ("industryDisplayName".equals(keys[i])) {
				String list = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + list);
				JSONArray listJarr = JSONArray.parseArray(list);
				List<String> assList = new ArrayList<>();
				Object[] arr = listJarr.toArray();
				for (int j = 0; j < arr.length; j++) {
					String arrValue = arr[j].toString();
					assList.add(arrValue);
				}
				hit.setIndustryDisplayName(assList);
			}
			if ("count".equals(keys[i])) {
				hit.setCount(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
		}
		log.info("--------------------------------------");
		return hit;
	}

	public HitsResultsForDimCross forResultsForDimCross(JSONObject jobHit, Object[] keys) {
		HitsResultsForDimCross hit = new HitsResultsForDimCross();
		for (int i = 0; i < keys.length; i++) {
			if ("originalDimType".equals(keys[i])) {
				hit.setOriginalDimType(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
			if ("matchDimType".equals(keys[i])) {
				hit.setMatchDimType(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
			if ("count".equals(keys[i])) {
				hit.setCount(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
		}
		log.info("--------------------------------------");
		return hit;
	}

	public HitsCrossPartner forCrossPartner(JSONObject jobHit, Object[] keys) {
		HitsCrossPartner hit = new HitsCrossPartner();
		for (int i = 0; i < keys.length; i++) {
			if ("industryDisplayName".equals(keys[i])) {
				hit.setIndustryDisplayName(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
			if ("count".equals(keys[i])) {
				hit.setCount(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
		}
		log.info("--------------------------------------");
		return hit;
	}

	public HitsForDimCross forHitsForDimCross(JSONObject jobHit, Object[] keys) {
		HitsForDimCross hit = new HitsForDimCross();
		for (int i = 0; i < keys.length; i++) {
			if ("originalDimType".equals(keys[i])) {
				hit.setOriginalDimType(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
			if ("matchDimType".equals(keys[i])) {
				hit.setMatchDimType(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
			if ("industryDisplayName".equals(keys[i])) {
				hit.setIndustryDisplayName(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
			if ("count".equals(keys[i])) {
				hit.setCount(jobHit.get(keys[i]).toString());
				String value = jobHit.get(keys[i]).toString();
				log.info(keys[i] + ":" + value);
			}
		}
		log.info("--------------------------------------");
		return hit;
	}

}
